package models;

import tools.OperateSql;
import tools.ReadProperties;

import java.util.HashMap;

/**
 * Created by yangxianming on 2017/6/16.
 */
public class MyConfig {
    public ReadProperties getPropertiesConfig() {
        return propertiesConfig;
    }

    public void setPropertiesConfig(ReadProperties propertiesConfig) {
        this.propertiesConfig = propertiesConfig;
    }

    public OperateSql getOperateSql() {
        return operateSql;
    }

    public void setOperateSql(OperateSql operateSql) {
        this.operateSql = operateSql;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getSplitMark(String mark) {
        // mark=startCmd OR splitMark
        return this.splitMark.get(mark);
    }

    public void setSplitMark() {
        this.splitMark.put("startCmd", "cmd /c ");
        this.splitMark.put("splitMark", "\\");
        if (!System.getProperty("os.name").contains("Windows")){
            this.splitMark.put("startCmd", "");
            this.splitMark.put("splitMark", "/");
        }
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    private HashMap<String, String> splitMark = new HashMap<String, String>();   //通过系统名称获取路径的分割符号
    //app.properties中的数据
    private ReadProperties propertiesConfig;
    //数据库连接
    private OperateSql operateSql;
    //update的token值
    private String token = "";
    //
    private User user;


}
